package com.samoiloff.ui.progress {
	import flash.display.MovieClip;
	/**
	 * @author Admin
	 */
	public class ProgressHeightController {
		
		private var _mc		: MovieClip;		
		private var _hitMc	: MovieClip;
		private var _maxHeight: int;

		private var _progress: Number;
		
		public function ProgressHeightController(mc:MovieClip) {
			_mc = mc;
			_hitMc = _mc.hitMc;
			_maxHeight = _hitMc.height;
			
			progress = 0;
		}
		
		public function destroy():void {
			_mc = null;
			_hitMc = null;
		}

		public function get progress(): Number {
			return _progress;
		}
		
		public function set progress(progress: Number): void {
			_progress = progress;
			if (_progress < 0) { _progress = 0; }
			if (_progress > 1) { _progress = 1; }
			_hitMc.height = _progress * _maxHeight;
		}

		public function get hitMc(): MovieClip {
			return _hitMc;
		}
		
		public function get mc(): MovieClip {
			return _mc;
		}
	}
}
